<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html">
  <h:head>
    <title>Facelet Title</title>
  </h:head>
  <h:body>
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
                    xmlns:h="http://java.sun.com/jsf/html"
                    xmlns:f="http://java.sun.com/jsf/core"
                    xmlns:c="http://java.sun.com/jsp/jstl/core"
                    xmlns:ace="http://www.icefaces.org/icefaces/components"
                    xmlns:icecore="http://www.icefaces.org/icefaces/core"
                    xmlns:ui="http://java.sun.com/jsf/facelets"
                    template="layout.xhtml">
      <ui:define name="title">My messages / Awesome Dates</ui:define>
      <ui:define name="content">
        <ace:panel header="Subject: #{reader.message.subject}" style="width: 500px">
          <p>Message from: #{reader.mbMessage.selectedUsername}</p>
          <h:outputText id="message" value="#{reader.message.messageText}">   

          </h:outputText> 

        </ace:panel>

        <h:form>
          <h:commandButton value="Reply" rendered="#{userManager.user.isPrivileged}" action="#{reader.reply(reader.mbMessage.selectedUsername)}"></h:commandButton>
          <h:inputHidden value="#{reader.sendToUsername}"/>
          <h:commandButton value="Upgrade" rendered="#{!userManager.user.isPrivileged}" action="payPal"></h:commandButton>
          <h:commandButton value="Back to inbox" action="myMessages"/>


        </h:form>

      </ui:define>
    </ui:composition>
  </h:body>
</html>

